#include <algorithm>
#include <cstdio>
#include <cstring>

typedef long long ll;
const int N = 200005, mod = 1e9 + 7, M = 2005;
int n, h, w;
ll ans, f[M], fac[N] = {1}, inv[N];

struct Node {
  int x, y;
  inline bool operator<(const Node &rhs) { return x == rhs.x ? y < rhs.y : x < rhs.x; }
} a[M];

inline ll qpow(ll base, int exp) {
  ll res = 1;
  while (exp) {
    if (exp & 1) (res *= base) %= mod;
    exp >>= 1;
    (base *= base) %= mod;
  }
  return res;
}

inline ll C(int n, int m) {
  return (m > n || m < 0 || n < 0) ? 0 : fac[n] * inv[m] % mod * inv[n - m] % mod;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("CppTest.in", "r", stdin);
  freopen("CppTest.out", "w", stdout);
#endif
#endif

  scanf("%d%d%d", &h, &w, &n);
  for (int i = 1; i < N; ++i) fac[i] = fac[i - 1] * i % mod;
  inv[N - 1] = qpow(fac[N - 1], mod - 2);
  for (int i = N - 2; ~i; --i) inv[i] = inv[i + 1] * (i + 1) % mod;

  for (int i = 1; i <= n; ++i) scanf("%d%d", &a[i].x, &a[i].y);
  std::sort(a + 1, a + n + 1);
  a[++n].x = h, a[n].y = w;
  for (int i = 1; i <= n; ++i) {
    f[i] = C(a[i].x + a[i].y - 2, a[i].x - 1);
    for (int j = 1; j < i; ++j)
      (f[i] -= f[j] * C(a[i].x - a[j].x + a[i].y - a[j].y, a[i].y - a[j].y) % mod) %= mod;
    f[i] = (f[i] + mod) % mod;
  }
  printf("%lld", f[n]);
  return 0;
}